package com.example.payment.dao.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "transaction")
public class Transaction {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long amount;
    @TableField(value = "order_id")
    private String orderId;
    @TableField(value = "user_id")
    private Long userId;
    @TableField(value = "credit_card")
    private String creditCard;
}

//CREATE TABLE `transaction` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '交易ID',
//    `amount` BIGINT NOT NULL COMMENT '交易金额（单位：分）',
//    `order_id` VARCHAR(64) NOT NULL COMMENT '订单ID',
//    `user_id` BIGINT NOT NULL COMMENT '用户ID',
//    `credit_card` VARCHAR(19) NOT NULL COMMENT '信用卡号',
//    PRIMARY KEY (`id`),
//    UNIQUE KEY `uniq_order` (`order_id`),
//    INDEX `idx_user` (`user_id`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付交易表';